package com.treeroot.linkedlist;

public class SingleLinkedListDemo {
    public static void main(String[] args) {
        //创建节点
        HeroNode songJiangNode = new HeroNode(1, "宋江", "及时雨");
        HeroNode LuJunYiNode = new HeroNode(2, "卢俊义", "玉麒麟");
        HeroNode WuYongNode = new HeroNode(3, "吴用", "智多星");
        HeroNode LinNode = new HeroNode(4, "林冲", "豹子头");
        //创建链表
        SingleLinkedList singleLinkedList = new SingleLinkedList();
        System.out.println("------------------------------创建一个链接------------------------------");
        singleLinkedList.addPlus(LuJunYiNode);
        singleLinkedList.addPlus(LinNode);
        singleLinkedList.addPlus(WuYongNode);
        singleLinkedList.addPlus(songJiangNode);
        singleLinkedList.list();
        System.out.println("------------------------------修改后------------------------------");
        singleLinkedList.update(new HeroNode(2, "傻逼卢俊义", "傻逼玉麒麟"));
        singleLinkedList.list();
        System.out.println("------------------------------删除一个节点------------------------------");
        singleLinkedList.delete(1);
        singleLinkedList.list();

    }
}
